package ebcs.scan.service.sys.fileStorage;

import java.util.List;

import ebcs.database.bean.sys.FileStorage;
import ebcs.scan.bean.sys.FileStorageBean;
import jplat.error.exception.JTransException;

/**
 * 操作所有文件
 * @author chenzhuo
 * @date 2018-11-16
 * @comment
 */
public interface FileStorageService {
	
	//保存文件信息(存储实体bean，odata 文件字节流)，返回stoageid
	public String writeToFileStorage(FileStorageBean fileStorage)  throws JTransException;
	public FileStorage writeToFileStorageReturnObject(FileStorageBean fileStorage) throws JTransException;
	//查询文件(读取文件字节)
	public byte[] loadFileInStorage(String storageId)  throws JTransException;
	//查询文件(读取文件文本)
	public String loadFileInStorage(String storageId,String charset ) throws JTransException;
	//
	/**
	 * 
	 * @Title: loadFileStoragEntity   
	 * @Description: TODO(查询文件信息)   
	 * @param: @param storageId
	 * @param: @return
	 * @param: @throws JTransException      
	 * @return: FileStorageBean      
	 * @throws
	 */
	public FileStorageBean  loadFileStoragEntity(String storageId) throws JTransException;
	//
	/**
	 * 
	 * @Title: updateFileStorage   
	 * @Description: TODO(根据实体类型更新文件信息)   
	 * @param: @param storageId
	 * @param: @param entityType
	 * @param: @param entityNo
	 * @param: @param entityName
	 * @param: @return      
	 * @return: int  更新数据条数    
	 * @throws
	 */
	public int updateFileStorage(String storageId, String entityNo, String entityName,String entityType);
	/**
	 * 
	 * @Title: searchLatelyFileStorageList   
	 * @Description: TODO(根据实体信息查询最近存储文件信息)   
	 * @param: @param entityType
	 * @param: @param entityNo
	 * @param: @param entityName
	 * @param: @return 文件信息
	 * @return: FileStorageBean      
	 * @throws
	 */
	public FileStorageBean searchLatelyFileStorageList(String entityNo,String entityName,String entityType);
	/**
	 * 
	 * @Title: searchFileStorageByStoageId   
	 * @Description: TODO(根据实体信息查询最近存储文件信息)   
	 * @param: @param entityType
	 * @param: @param entityNo
	 * @param: @param entityName
	 * @param: @return 文件信息
	 * @return: FileStorageBean      
	 * @throws
	 */
	public FileStorageBean searchFileStorageByStorageId(String storageId);

	
	//更新PDF文件页数
	public int updatePdfLength(String storageId,int pdfLength);
}
